<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>代理注册</title>
		<script src="js/lib/jquery-1.11.0.js"></script>
		<link rel="stylesheet" href="css/lib/bootstrap.min.css"/>
		<link rel="stylesheet" href="css/lib/loading.css" />
		<script src="js/lib/bootstrap.min.js"></script>
		<script src="js/lib/loading.js"></script>
		<!--<script src="js/lib/angular.min.js"></script>-->
		<script src="js/base.js" type="text/javascript" charset="utf-8"></script>
	</head>
	<style>
		body{
			font-size:12px;
		}		
		table,
		th,
		td {
			border: 1px solid #eee;
			border-collapse: collapse;
			padding: 5px;
			vertical-align: middle !important;
		}		
		/* table td:nth-child(odd) {
			background-color: #f1f1f1;
			
		} */
		table td:nth-child(even) {
			
		}
		table tr:nth-child(even) {
			background-color:#ffffff;
		}
	</style>
	<body ng-app="myApp" ng-controller="customersCtrl">		
		<div class="">
		<!--加载动画-->
		<div class="wrapper">
            <div id="loader-wrapper">
                <div id="loader"></div>
            </div>
        </div>
			<div style="padding:15px 5px 0px 5px;border:.5px solid #ccc;margin-bottom:15px;box-shadow:3px 5px 15px">
			<table class="table table-hover">				
				<tbody>
					<tr>
						<th colspan="12" style="font-size:26px;color:#337ab7">代替用户开户：&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<!-- <a href="06.html">【管理已有下级会员】</a> --></th>
					</tr>
					<tr>
						<td style="width:12%">手机号码:</td>
						<td colspan="12">
						<input id="msg0" type="text" class="form-control" style="width:280px;" placeholder="请输入注册号码"/>
						</td>											
					</tr>
					<tr>
						<td>所属上级号码:</td>
						<td colspan="12">
						<input id="msg1" placeholder="请输入上级号码" value="" class="form-control" type="text" style="width:280px;">						
						</td>	
					</tr>
					
					<tr>
						<td colspan="12">
							<button id="btn" class="btn btn-danger" style="display:block;margin:0 0 0 300px;"/>注册</button>							
						</td>
					</tr>
					<tr>
						<td colspan="12">
							<p style="color:red">所注册用户的默认登陆密码和支付密码均为“123456”</p>
						</td>
					</tr>
				</tbody>
			</table>					
			</div>
			</div>
		</div>
	</body>
	<script>
	$(function(){		
		var brandid = sessionStorage.getItem(key=3);
		var brandname = sessionStorage.getItem(key=100);
		$('#btn').click(function(){
			
			var msg0 = $('#msg0').val();
			var msg1 = $('#msg1').val();
			
			if(msg0=="" || msg1==""){
				alert('请完善输入信息')
			}else{
					$.ajax({
					type:"POST",
					url:window.baseUrl+"user/pre/register",
					async:true,
					dataType:"json",
					data:{
						phone:msg0,
						invitecode:msg1,
						brand_id:brandid,
						brand_name:brandname
					},
					success:function(data){						
						alert(data.resp_message)						
						console.log(data)
						$('#msg0').val()
						$('#msg1').val()					
					},
					error:function(data){
						alert('注册失败！')
					}
				});
			}		
		})
	});
</script>
</html>


